import service from "../index";

//获取提问列表
export const getAllQues = async () => {
  return await service({
    method: "get",
    url: "/QandA/getAllQues",
  });
};

//添加提问
export const addQues = async (params: any) => {
  return await service({
    method: "post",
    url: "/QandA/addQues",
    data: params,
  });
};

//删除提问
export const deleteQues = async (id: number) => {
  return await service({
    method: "get",
    url: "/QandA/deleteQues?id=" + id,
  });
};

//批量删除提问
export const batchDeleteQues = async (params: any) => {
  return await service({
    method: "post",
    url: "/QandA/batchDeleteQues",
    data: params,
  });
};

//修改提问
export const updateQues = async (params: any) => {
  return await service({
    method: "post",
    url: "/QandA/updateQues",
    data: params,
  });
};

//获取回复
export const getAnswer = async (id: any) => {
  return await service({
    method: "get",
    url: "/QandA/getAnswer?id=" + id,
  });
};

//添加回复
export const addAns = async (params: any) => {
  return await service({
    method: "post",
    url: "/QandA/addAns",
    data: params,
  });
};

//删除回复
export const deleteAns = async (id: any) => {
  return await service({
    method: "get",
    url: "/QandA/deleteAns?id=" + id,
  });
};
